<?php

class Form_AddUserFeed extends Zend_Form 
{

	/**
	
	 */	
    public function init()
    {
        $this->setAction('/feed/adduserfeed');
        $this->setMethod('POST');
        
        $this->setElementFilters(array('StringTrim'));
        
        $this->setAttrib('class', 'formstyle backgroundForm');
        $this->setAttrib('id', 'formfeed');

               
        // Add URL element
        $url = new Zend_Form_Element_Text('url');
        $url->setLabel('URL:')
             ->setAttrib('readonly', 'true')
             ->setAttrib('class', 'field fieldurl')
             ->setAttrib('onkeyup','checkURL(this);')
             ->setAttrib('onclick','checkURL(this);')
             ->setRequired(true)
             ->setDecorators(array(
                   array('ViewHelper', array('helper'=>'formText')),
                   array('Label', array('class'=>'gray labelfield')),
                   array('Errors', array('tag' => 'span'))
        ));
        
        $category = new Zend_Form_Element_Select('category');
        $category->setLabel('category')
                 ->setAttrib('id', 'feedcategory')
                 ->setAttrib('class', 'field NoHints')
                 ->setRequired(true)
                 ->setRegisterInArrayValidator(false)
                 ->setDecorators(array(
                       array('ViewHelper'),
                       array('Label', array('separator'=>' ', 'class'=>'gray labelfield')),
                       array('Errors')
                 ));
        
        // Add a submit button
        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel('save')
               ->setAttrib('class', 'profileSubmit')
               ->setDecorators(array(
                   array('ViewHelper', array('helper'=>'formSubmit'))
        ));
        
        $param = new Zend_Form_Element_Hidden('param');
        $param->setDecorators(array('ViewHelper'));
        $param->setValue('1');
        
        $this->addElements(array(
            $url,
            $category,
            $param,
            $submit
        ));
        
        $this->setDecorators(array(
            'FormElements',
            'Form'
        ));
    }
}
